package com.thon.dao.topic.impl;

import com.thon.commons.persistence.BaseDaoImpl;
import com.thon.dao.topic.TopicDao;
import com.thon.entity.topic.Topic;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Chen on 2016/2/9.
 */
@Repository
public class TopicDaoImpl extends BaseDaoImpl<Topic> implements TopicDao{

    public TopicDaoImpl() {
        super(Topic.class);
    }

    @Override
    public List<Topic> hasPushTopic(Integer id) {
        String queryString = "FROM Topic c WHERE c.creator.id = ? AND c.pass IN (0,2,4)";

        return findList(queryString, id);
    }
}
